package com.cman777.springc.springcloudalibaba.sample.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenzhicong
 * @time 2020/6/9 14:27
 */
@RefreshScope
@RestController
public class TestController {

    @Value("${user.name}")
    String userName;

    @Value("${user.age}")
    int age;

    @GetMapping("/user")
    public String test(){
        return "userName="+userName+",age=" + age;
    }
}
